package com.wechat.robot;

import java.util.concurrent.CompletableFuture;

import com.swak.annotation.Flux;
import com.wechat.command.Command;
import com.wechat.command.CommandResult;
import com.wechat.network.NetworkChannel;

/**
 * 助手 - 机器人
 * 
 * 1. Flux.$nextTick 异步的执行任务，channel 可以输出给远端
 * 
 * 2. 顺序的执行
 * 
 * @author 618lf
 */
@Flux
@com.wechat.annotation.Robot(id = "HelperRobot", name = "聊天助手", pool = "HelperRobot")
public class HelperRobot extends Robot {

	/**
	 * 接收消息
	 * 
	 * @param channel -- 通道
	 * @param command -- 命令
	 * @return
	 */
	public CompletableFuture<CommandResult> recv(NetworkChannel channel, Command command) {
		if (logger.isDebugEnabled()) {
			logger.debug("[机器人 聊天助手] 执行命令, {}", command.getData());
		}
		return CompletableFuture.completedFuture(CommandResult.SUCCESS);
	}
}